#include <bits/stdc++.h>
using namespace std;
int main(){
    int t,c1,c2,n;
    cin>>t;
    while(t--){
        cin>>n;
        c1=c2=n/3;
        n%=3;
        if(n==2){
            c2++;
        }else if(n==1){
            c1++;
        }
        cout<<c1<<' '<<c2<<endl;
    }
    return 0;
}